home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 197 / tosystem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-20  |  799 b   |  26 lines

  1. /* tosystem.c                                                     20Aug89 */
  2. /* int system();  supplied by TRBurkey for uumail port to MWC on ATARI-ST */
  3. /* This is a featureless shell function, providing status response only.  */
  4. /* usage:   System("program_name  arg1  arg2  arg3  etc. ");              */
  5.  
  6. #include <osbind.h>
  7. #include <string.h>    
  8.  
  9. int system(string)  char *string;   {
  10.       int k, i, loadgo = 0;
  11.       char pname[200],ptal[200];
  12.       strcpy(pname,string);
  13.       k=strlen(pname);
  14.       for(i = 0; i < k && pname[i] != ' ' ; i++);
  15.           if(pname[i]==' ') {
  16.                 pname[i]='\0';
  17.                 strcpy(ptal,&string[i]);
  18.                 ptal[0]=strlen(ptal);
  19.             }  else {
  20.                 ptal[0]=0;
  21.                 ptal[1]='\0';
  22.             }
  23.       return((int)(Pexec(loadgo,pname,ptal,"PATH=\0A:\\\0")));
  24. }  
  25.  
  26.